package com.dragon.modules.yuegou.model.product;

import com.dragon.modules.yuegou.entity.product.SkuEntity;
import com.dragon.modules.yuegou.enums.OwnerType;
import com.dragon.modules.yuegou.enums.SkuType;
import com.dragon.modules.yuegou.enums.product.SkuSettlementType;
import com.dragon.modules.yuegou.enums.product.SpuShowModule;
import com.dragon.modules.yuegou.model.merchant.Merchant;
import com.fasterxml.jackson.annotation.JsonView;
import io.swagger.annotations.ApiModelProperty;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;

/**
 * SKU模型类
 * 
 * @author pbuilder generated
 * @date 2019-07-22 16:17:04
 * @company sgy
 * @version 2.0
 * @see Length 长度限制
 * @see NotNull 对象非空
 * @see NotEmpty 字符串、集合、表、数组非空
 */
public class Sku extends SkuEntity {

	private Spu spu;
	
	@ApiModelProperty("商品规格属性")
	private List<AttrSkuRef> attrSkuRef;

	@ApiModelProperty("模板id")
	private String templateId;

	@ApiModelProperty("单个可核销商户信息")
	private Merchant merchant;

	private List<Merchant> merchantList;

	@ApiModelProperty("商品属性")
	private List<Attribute> attributesList;

	@ApiModelProperty("sku总量")
	private Integer total;

	@ApiModelProperty("sku销量")
	private Integer sale;

	@ApiModelProperty("套餐商品内商品列表")
	private List<Sku> skuList;

	@ApiModelProperty("sku购买数量")
	private Integer buyNum;

	/**
	 * 库存信息
	 */
	@ApiModelProperty("sku库存")
	private Stock  stock;

	@ApiModelProperty("套餐内sku数量")
	private Integer skuStock;

	@ApiModelProperty("悦卡详情页主图")
	private String detailImgUrl;

	@ApiModelProperty("积分商品可使用商铺")
	private String merchantNames;

	@ApiModelProperty("使用说明")
	private String info;

	@ApiModelProperty("有效期开始时间")
	private LocalDateTime beginTime;
	
	@ApiModelProperty("有效期结束时间")
	private LocalDateTime endTime;
	
	@ApiModelProperty("库存")
	private Integer stockQuantity;
	
	@ApiModelProperty("所属模块")
	private SpuShowModule showModule;
	
	@ApiModelProperty("商品描述(旧)")
	private String description;
	
	@ApiModelProperty("商品描述(旧)")
	private String imgDescription;

	@ApiModelProperty("会员折扣后金额")
	private BigDecimal memberPrice;
	
	@ApiModelProperty("商品类型：0,优质好货，1到家商品，2，积分商品")
	private Integer productType;
	
	/** 售卖开始时间 */
	@ApiModelProperty("售卖开始时间")
	protected LocalDateTime sellBeginTime;
	
	/** 售卖结束时间 */
	@ApiModelProperty("售卖结束时间")
	protected LocalDateTime sellEndTime;

	/** 售卖开始时间 */
	@ApiModelProperty("售卖开始日期")
	protected LocalDate sellBeginDate;

	/** 售卖结束时间 */
	@ApiModelProperty("售卖结束日期")
	protected LocalDate sellEndDate;

	
	/** 倒计时开始时间 */
	@ApiModelProperty("倒计时开始时间")
	protected LocalDateTime invertedBeginTime;

	/** 倒计时结束时间 */
	@ApiModelProperty("倒计时结束时间")
	protected LocalDateTime invertedEndTime;

	@ApiModelProperty("[枚举]是否显示倒计时：0-不显示-HIDE、1-显示-SHOW")
	protected Integer invertedShow;

	public String getTemplateId() {
		return templateId;
	}

	public void setTemplateId(String templateId) {
		this.templateId = templateId;
	}

	public Integer getStockQuantity() {
		return stockQuantity;
	}

	public void setStockQuantity(Integer stockQuantity) {
		this.stockQuantity = stockQuantity;
	}

	public SpuShowModule getShowModule() {
		return showModule;
	}

	public void setShowModule(SpuShowModule showModule) {
		this.showModule = showModule;
	}

	public LocalDateTime getBeginTime() {
		return beginTime;
	}

	public void setBeginTime(LocalDateTime beginTime) {
		this.beginTime = beginTime;
	}

	public LocalDateTime getEndTime() {
		return endTime;
	}

	public void setEndTime(LocalDateTime endTime) {
		this.endTime = endTime;
	}
	
	public String getDescription() {
		return description;
	}
	
	public void setDescription(String description) {
		this.description = description;
	}
		
	public Integer getProductType() {
		return productType;
	}

	public void setProductType(Integer productType) {
		this.productType = productType;
	}

	public String getImgDescription() {
		return imgDescription;
	}
	
	public void setImgDescription(String imgDescription) {
		this.imgDescription = imgDescription;
	}


	public BigDecimal getMemberPrice() {
		return memberPrice;
	}

	public void setMemberPrice(BigDecimal memberPrice) {
		this.memberPrice = memberPrice;
	}

	/**
	 * 构造一个空SKU模型对象
	 */
	public Sku(){
		super();
	}
	
	/**
	 * 依据实体对象的信息构造一个SKU模型对象
	 * 
	 * @param entity 实体对象
	 */
	public Sku(SkuEntity entity){
		super(entity);
	}

	/**
	 * 依据其它对象的信息构造一个SKU模型对象
	 * 
	 * @param other 其它对象
	 */
	public Sku(Sku other){
		super(other);
	}

	public Spu getSpu() {
		return spu;
	}

	public void setSpu(Spu spu) {
		this.spu = spu;
	}

	public String getMerchantNames() {
		return merchantNames;
	}

	public void setMerchantNames(String merchantNames) {
		this.merchantNames = merchantNames;
	}

	public String getInfo() {
		return info;
	}

	public void setInfo(String info) {
		this.info = info;
	}

	public List<AttrSkuRef> getAttrSkuRef() {
		return attrSkuRef;
	}

	public void setAttrSkuRef(List<AttrSkuRef> attrSkuRef) {
		this.attrSkuRef = attrSkuRef;
	}

	public List<Merchant> getMerchantList() {
		return merchantList;
	}

	public void setMerchantList(List<Merchant> merchantList) {
		this.merchantList = merchantList;
	}

	public Merchant getMerchant() {
		return merchant;
	}

	public void setMerchant(Merchant merchant) {
		this.merchant = merchant;
	}

	public List<Attribute> getAttributesList() {
		return attributesList;
	}

	public void setAttributesList(List<Attribute> attributesList) {
		this.attributesList = attributesList;
	}

	public Integer getTotal() {
		return total;
	}

	public void setTotal(Integer total) {
		this.total = total;
	}

	public List<Sku> getSkuList() {
		return skuList;
	}

	public void setSkuList(List<Sku> skuList) {
		this.skuList = skuList;
	}

	/**
	 * 获得库存信息
	 */
	public Stock getStock() {
		return stock;
	}

	/**
	 * 设置库存信息
	 */
	public void setStock(Stock stock) {
		this.stock = stock;
	}

	public Integer getSkuStock() {
		return skuStock;
	}

	public void setSkuStock(Integer skuStock) {
		this.skuStock = skuStock;
	}

	public Integer getSale() {
		return sale;
	}

	public void setSale(Integer sale) {
		this.sale = sale;
	}

	@Override
	public String getId() {
    	return id;
    }

    /**
	 * 设置ID
	 * 
	 * @param id ID
	 * @return 当前对象
	 */
    public Sku id(String id) {
    	this.id = id;
    	return this;
    }

	@Override
	public SkuType getSkuType() {
    	return skuType;
    }

    /**
	 * 设置[全局枚举]商品类型：0-悦卡-YUECARD、1-套餐-PACKAGE、2-商户停车券-PARKCOUPON、3-积分停车券-POINTPARKCOUPON、4-实物-GOODS、5-积分商品-POINTGOODS、6-伪造商品-MOCK、7-奖品-PRIZE、8-优惠券-DISCOUNTCOUPON、9-礼包-GIFTBAG
	 * 
	 * @param skuType [全局枚举]商品类型：0-悦卡-YUECARD、1-套餐-PACKAGE、2-商户停车券-PARKCOUPON、3-积分停车券-POINTPARKCOUPON、4-实物-GOODS、5-积分商品-POINTGOODS、6-伪造商品-MOCK、7-奖品-PRIZE、8-优惠券-DISCOUNTCOUPON、9-礼包-GIFTBAG
	 * @return 当前对象
	 */
    public Sku skuType(SkuType skuType) {
    	this.skuType = skuType;
    	return this;
    }

	@Override
	public OwnerType getOwnerType() {
    	return ownerType;
    }

    /**
	 * 设置[全局枚举]所有者类型：0-平台-PLATFORM、1-集团-GROUP、2-商圈-BUSINESS_DISTRICT、3-商户-MERCHANT
	 * 
	 * @param ownerType [全局枚举]所有者类型：0-平台-PLATFORM、1-集团-GROUP、2-商圈-BUSINESS_DISTRICT、3-商户-MERCHANT
	 * @return 当前对象
	 */
    public Sku ownerType(OwnerType ownerType) {
    	this.ownerType = ownerType;
    	return this;
    }

	@Override
	public String getGroupId() {
    	return groupId;
    }

    /**
	 * 设置集团ID
	 * 
	 * @param groupId 集团ID
	 * @return 当前对象
	 */
    public Sku groupId(String groupId) {
    	this.groupId = groupId;
    	return this;
    }

	@Override
	public String getBusdId() {
    	return busdId;
    }

    /**
	 * 设置商圈ID
	 * 
	 * @param busdId 商圈ID
	 * @return 当前对象
	 */
    public Sku busdId(String busdId) {
    	this.busdId = busdId;
    	return this;
    }

	@Override
	public String getMerchantId() {
    	return merchantId;
    }

    /**
	 * 设置商家ID
	 * 
	 * @param merchantId 商家ID
	 * @return 当前对象
	 */
    public Sku merchantId(String merchantId) {
    	this.merchantId = merchantId;
    	return this;
    }

	@Override
	public String getSpuId() {
    	return spuId;
    }

    /**
	 * 设置商品ID
	 * 
	 * @param spuId 商品ID
	 * @return 当前对象
	 */
    public Sku spuId(String spuId) {
    	this.spuId = spuId;
    	return this;
    }

	@Override
	public String getTitle() {
    	return title;
    }

    /**
	 * 设置商品标题
	 * 
	 * @param title 商品标题
	 * @return 当前对象
	 */
    public Sku title(String title) {
    	this.title = title;
    	return this;
    }

	@Override
	public String getMainImages() {
    	return mainImages;
    }

    /**
	 * 设置主图
	 * 
	 * @param mainImages 主图
	 * @return 当前对象
	 */
    public Sku mainImages(String mainImages) {
    	this.mainImages = mainImages;
    	return this;
    }

	@Override
	public String getImages() {
    	return images;
    }

    /**
	 * 设置商品图片 JSON存储
	 * 
	 * @param images 商品图片 JSON存储
	 * @return 当前对象
	 */
    public Sku images(String images) {
    	this.images = images;
    	return this;
    }

	@Override
	public String getAttrs() {
    	return attrs;
    }

    /**
	 * 设置规格属性 JSON存储
	 * 
	 * @param attrs 规格属性 JSON存储
	 * @return 当前对象
	 */
    public Sku attrs(String attrs) {
    	this.attrs = attrs;
    	return this;
    }

	@Override
	public String getCode() {
    	return code;
    }

    /**
	 * 设置商品编码
	 * 
	 * @param code 商品编码
	 * @return 当前对象
	 */
    public Sku code(String code) {
    	this.code = code;
    	return this;
    }

	@Override
	public BigDecimal getOriginalPrice() {
    	return originalPrice;
    }

    /**
	 * 设置原价
	 * 
	 * @param originalPrice 原价
	 * @return 当前对象
	 */
    public Sku originalPrice(BigDecimal originalPrice) {
    	this.originalPrice = originalPrice;
    	return this;
    }

	@Override
	public BigDecimal getPrice() {
    	return price;
    }

    /**
	 * 设置价格
	 * 
	 * @param price 价格
	 * @return 当前对象
	 */
    public Sku price(BigDecimal price) {
    	this.price = price;
    	return this;
    }

	@Override
	public BigDecimal getDiscountPrice() {
    	return discountPrice;
    }

    /**
	 * 设置折扣价
	 * 
	 * @param discountPrice 折扣价
	 * @return 当前对象
	 */
    public Sku discountPrice(BigDecimal discountPrice) {
    	this.discountPrice = discountPrice;
    	return this;
    }
    
    @Override
	public BigDecimal getSettlementPrice() {
    	return settlementPrice;
    }

    /**
	 * 设置结算价
	 * 
	 * @param settlementPrice 结算价
	 * @return 当前对象
	 */
    public Sku settlementPrice(BigDecimal settlementPrice) {
    	this.settlementPrice = settlementPrice;
    	return this;
    }

	@Override
	public SkuSettlementType getSettlementType() {
		return settlementType;
	}


	public Sku settlementType(SkuSettlementType settlementType) {
		this.settlementType = settlementType;
		return this;
	}

	@Override
	public BigDecimal getOwnerPrice() {
		return ownerPrice;
	}


	public Sku ownerPrice(BigDecimal ownerPrice) {
		this.ownerPrice = ownerPrice;
		return this;
	}

	@Override
	public Integer getPoint() {
    	return point;
    }

    /**
	 * 设置积分
	 * 
	 * @param point 积分
	 * @return 当前对象
	 */
    public Sku point(Integer point) {
    	this.point = point;
    	return this;
    }

	@Override
	public LocalDateTime getCreatedTime() {
    	return createdTime;
    }

    /**
	 * 设置创建时间
	 * 
	 * @param createdTime 创建时间
	 * @return 当前对象
	 */
    public Sku createdTime(LocalDateTime createdTime) {
    	this.createdTime = createdTime;
    	return this;
    }

	@Override
	public String getModifiedBy() {
    	return modifiedBy;
    }

    /**
	 * 设置更新人ID
	 * 
	 * @param modifiedBy 更新人ID
	 * @return 当前对象
	 */
    public Sku modifiedBy(String modifiedBy) {
    	this.modifiedBy = modifiedBy;
    	return this;
    }

	@Override
	public LocalDateTime getModifiedTime() {
    	return modifiedTime;
    }

    /**
	 * 设置更新时间
	 * 
	 * @param modifiedTime 更新时间
	 * @return 当前对象
	 */
    public Sku modifiedTime(LocalDateTime modifiedTime) {
    	this.modifiedTime = modifiedTime;
    	return this;
    }

	@Override
	public Boolean getDel() {
    	return del;
    }

    /**
	 * 设置是否删除（1：已删除，0：未删除）
	 * 
	 * @param del 是否删除（1：已删除，0：未删除）
	 * @return 当前对象
	 */
    public Sku del(Boolean del) {
    	this.del = del;
    	return this;
    }

	@Override
	public String getDelBy() {
    	return delBy;
    }

    /**
	 * 设置删除人ID
	 * 
	 * @param delBy 删除人ID
	 * @return 当前对象
	 */
    public Sku delBy(String delBy) {
    	this.delBy = delBy;
    	return this;
    }

	@Override
	public LocalDateTime getDelTime() {
    	return delTime;
    }

    /**
	 * 设置删除时间
	 * 
	 * @param delTime 删除时间
	 * @return 当前对象
	 */
    public Sku delTime(LocalDateTime delTime) {
    	this.delTime = delTime;
    	return this;
    }

	@Override
	public Integer getMaxBuyNum() {
    	return maxBuyNum;
    }

    /**
	 * 设置每人最大购买数量
	 * 
	 * @param maxBuyNum 每人最大购买数量
	 * @return 当前对象
	 */
    public Sku maxBuyNum(Integer maxBuyNum) {
    	this.maxBuyNum = maxBuyNum;
    	return this;
    }

	public Integer getBuyNum() {
		return buyNum;
	}

	public void setBuyNum(Integer buyNum) {
		this.buyNum = buyNum;
	}


	public String getDetailImgUrl() {
		return detailImgUrl;
	}

	public void setDetailImgUrl(String detailImgUrl) {
		this.detailImgUrl = detailImgUrl;
	}
		

	public LocalDateTime getSellBeginTime() {
		return sellBeginTime;
	}

	public void setSellBeginTime(LocalDateTime sellBeginTime) {
		this.sellBeginTime = sellBeginTime;
	}

	public LocalDateTime getSellEndTime() {
		return sellEndTime;
	}

	public void setSellEndTime(LocalDateTime sellEndTime) {
		this.sellEndTime = sellEndTime;
	}

	public LocalDate getSellBeginDate() {
		return sellBeginDate;
	}

	public void setSellBeginDate(LocalDate sellBeginDate) {
		this.sellBeginDate = sellBeginDate;
	}

	public LocalDate getSellEndDate() {
		return sellEndDate;
	}

	public void setSellEndDate(LocalDate sellEndDate) {
		this.sellEndDate = sellEndDate;
	}

	public LocalDateTime getInvertedBeginTime() {
		return invertedBeginTime;
	}

	public void setInvertedBeginTime(LocalDateTime invertedBeginTime) {
		this.invertedBeginTime = invertedBeginTime;
	}
	
	public LocalDateTime getInvertedEndTime() {
		return invertedEndTime;
	}

	public void setInvertedEndTime(LocalDateTime invertedEndTime) {
		this.invertedEndTime = invertedEndTime;
	}

	public Integer getInvertedShow() {
		return invertedShow;
	}

	public void setInvertedShow(Integer invertedShow) {
		this.invertedShow = invertedShow;
	}

}
